package com.goldenKey.common.constant;

public class Constant {

    // 限制字符串包含数字、字母以及指定的特殊字符，长度在 8 到 16 个字符之间  (以下为密码、邮箱限制）
    public static final String REGEX_PASSWORD = "^(?=.*\\d)(?=.*[a-zA-Z])[a-zA-Z0-9~!@#$%^&*_]{8,16}$";
    public static final String REGEX_EMAIL = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$";

    // 测试
    public static final String tst = "tst";

    // 验证码的存活时间（1分钟）
    public static final Integer REDIS_KEY_SURVIVAL_ONE_MIN = 60 * 1000;

    // token的存活时间（1天）
    public static final Integer KEY_SURVIVAL_ONE_DAY = REDIS_KEY_SURVIVAL_ONE_MIN * 60 * 24;

    // 用户、管理员token缓存在Redis的key前缀
    public static final String REDIS_KEY_TOKEN_USER =  "token:user:";
    public static final String REDIS_KEY_TOKEN_ADMIN =  "token:admin:";

    // 常量1,0,10
    public static final Integer ONE_CONSTANT = 1;
    public static final Integer ZERO_CONSTANT = 0;
    public static final Integer LENGTH_10 = 10;

    // 分类树
    public static final String REDIS_KEY_CATEGORY_LIST = "category:list:";

    // 图形验证码、邮箱验证码Key 以及时间戳
    public static final String CAPTCHA_KEY = "captcha-key";
    public static final String EMAIL_CODE_KEY = "email_code";
    public static final String EMAIL_CODE_TIMESTAMP_KEY = "email_code_timestamp";
    // Redis的验证码的key前缀
    public static final String REDIS_KEY_CODE = "captcha:";
}
